package innerclass;

import org.w3c.dom.ls.LSOutput;

/**
 * User: 86156
 * Date: 2023-04-13
 * Time: 9:05
 */
public class Car {
    String CarName;
    int CarAge;
    char CarColor;


    public void show(){
        Engine e = new Engine();
        System.out.println(e.EngineName);
    }

    class Engine{

        /*
        * 内部类的访问特点
        *  内部类中可以访问外部类的所有成员,包括私有
        *  外部类中想要访问内部类的成员,只能通过创建对象来访问
        * */

        String EngineName;
        int EngineAge;

        public void show(){
            System.out.println(EngineName);
            System.out.println(CarName);
        }

    }
}
